package com.kksoft.readcm.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.kksoft.readcm.a.Appconfig;
import com.kksoft.readcm.objects.n;
import com.kksoft.readcm.pro.R;

public class ReadingListActivity extends ListViewActivity
{
  private RelativeLayout lstHeader = null;

  protected final void SetCoustomView(int i)
  {
	  super.SetCoustomView(i);
      if(i == 1)
          lstHeader.setVisibility(View.GONE);
      else
          lstHeader.setVisibility(View.VISIBLE);
  }

  protected final n a_()
  {
    n localn = Appconfig.getThis().getItemAppObservable().a();
    this.k = localn;
    return this.k;
  }

  protected final void b()
  {
    this.lstHeader = (RelativeLayout)View.inflate(this, R.layout.list_header_tags, null);
    this.lstHeader.setOnClickListener(new OnClickListener(){

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			ReadingListActivity.this.t();
		}
    	
    });
    this.d.addView(this.lstHeader);
  }

  protected final void b(Menu paramMenu)
  {
    super.b(paramMenu);
    paramMenu.add(-1, 25, 1, getString(R.string.nm_current_list)).setIcon(R.drawable.ic_menu_current_list);
    paramMenu.add(-1, 26, 2, getString(R.string.nm_read_list)).setIcon(R.drawable.ic_menu_archive);
  }

  protected final void b(boolean flag)
  {
	  super.b(flag);
      if(!flag)
          lstHeader.setVisibility(0);
      else
          lstHeader.setVisibility(8);
  }

  protected final String e()
  {
    return "sortReading";
  }

  protected final String f()
  {
    return getString(R.string.nm_reading_list);
  }

  protected final boolean g()
  {
    return true;
  }

  protected final int j()
  {
    return 1;
  }

  protected final void o()
  {
    HelpActivity.a(2, this);
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
  }

  protected final void t()
  {
    Intent localIntent = new Intent(this, TagDirectory.class);
    startActivity(localIntent);
  }

  protected final void v()
  {
	  if(Appconfig.getThis().b().a(true))
          c.setText(R.string.nm_syncing_list);
      else
      if(Appconfig.getThis().l())
      {
          c.setText(R.string.nm_fetching_reading_list);
      } else
      {
          TextView textview = c;
          textview.setText(getString(R.string.nm_reading_list));
      }
  }

  protected final String x()
  {
    return "filterReading";
  }
}